home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 483 b | 26 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 8, example 2
-
- -- example of catching
-
- module CatchingTest uses ScriptX end
- in module CatchingTest
-
- global a1:88, b1:0, c1, d1, e1
- guard (
- c1 := a1 / b1
- d1 := a1 - b1
- e1 := a1 / c1
- )
- catching
- divideByZero returnArg: (
- format debug "The number divided by 0 is: %*\n" throwArg @normal
- prin "The default error message is:\n" @unadorned debug
- prinln throwTag throwArg
- caught undefined
- )
- end
- -->>>
-